#!/bin/bash

# Webhook Agents 启动脚本

echo "正在启动 Webhook Agents..."
echo "配置文件: agent-config.yaml"
echo "日志级别: info"
echo "------------------------"

# 检查配置文件是否存在
if [ ! -f "agent-config.yaml" ]; then
    echo "错误: 找不到配置文件 agent-config.yaml"
    echo "请确保 agent-config.yaml 文件存在于当前目录中"
    exit 1
fi

# 编译并运行
echo "正在编译 Webhook Agents..."
go build -o webhook-agents main.go

if [ $? -eq 0 ]; then
    echo "编译成功!"
    echo "正在启动 Webhook Agents..."
    ./webhook-agents
else
    echo "编译失败!"
    exit 1
fi